﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StockEngine
{
    public class PlotGraph
    {

        public List<KeyValuePair<DateTime, int>> GraphPlotter(List<StockInfo> myStockInfoList, DateSpan dateSpan)
        {
            List<KeyValuePair<DateTime, int>> returnList = new List<KeyValuePair<DateTime, int>>();
            foreach (StockInfo stockInfo in myStockInfoList)
            {
                if (stockInfo.Date >= (DateTime.Today - dateSpan._Date) ||
                    (DateTime.Today - dateSpan._Date) == DateTime.Today)
                {
                    returnList.Add(new KeyValuePair<DateTime, int>(stockInfo.Date, stockInfo.Volume));    
                }
            }

            return returnList;
        }

    }
}
